import javax.swing.*;
import java.awt.*;

public class XPopupMenu {

    public  static JPopupMenu  createPopupMenu(){
        JPopupMenu popup=new JPopupMenu();
        popup.add(createMenuItem( "fileOpen","打开"));
        popup.add(createMenuItem( "fileSave","保存"));
        popup.add(createMenuItem("fileHelp","帮助"));
        return popup;
    }

     static JMenuItem createMenuItem(String action, String text)
    {
        JMenuItem item=new JMenuItem(text);
        item.setActionCommand(action);
        item.setBackground(Color.WHITE);
        item.setForeground(Color.black);
        return item;
    }

}
